package edu.seu.mart.model;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import edu.seu.mart.utils.MsgKit;

/**
 * 文本消息
 */
public class TextMsg extends BaseMsg {
    /**
     * 文本消息内容
     */
    @XStreamAlias("Content")
    private String content;
    /**
     * 消息id，64位整型
     */
    @XStreamAlias("MsgId")
    private long msgId;

    @Override
    public String toString() {
        return "ToUserName: " + toUserName
                + "\nFromUserName: " + fromUserName
                + "\nCreateTime: " + createTime
                + "\nMsgType: " + msgType
                + "\nContent: " + content
                + "\nMsgId: " + msgId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = MsgKit.addCData(content);
    }

    public long getMsgId() {
        return msgId;
    }

    public void setMsgId(long msgId) {
        this.msgId = msgId;
    }
}
